package com.ncmmall.domain.business.news;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import java.sql.Timestamp;

/**
 * 公告
 *
 * @author likaikai
 * @date 2019-07-11 10:13
 */
@Entity
@Table(name = "mall_news")
@Access(AccessType.FIELD)
@Getter
@Setter
public class News {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    /**
     * 标题
     */
    private String title;

    /**
     * 内容
     */
    @Lob
    private String content;

    /**
     * 1、下架
     * 2、上架
     */
    private int status;

    /**
     * 1、未推荐到首页
     * 2、推荐到首页
     */
    private int recommend;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Timestamp createTime;

    /**
     * 0、用户商城端
     * 1、商家采购端
     */
    private int platformType;

}
